#ifndef __API_VALVE_H
#define __API_VALVE_H

#include "bsp_gpio.h"
#include <stdbool.h>

#ifdef RTOS 

#include "FreeRTOS.h"
#include "task.h"
#include "timers.h"
#include "queue.h"
#include "semphr.h"
#include "event_groups.h"
#include "FreeRTOSConfig.h"

#endif

#ifdef __cplusplus
 extern "C" {
#endif

/*阀门的应用逻辑状态*/
typedef enum en_APP_valve_state
{
    ValveOpened = 0,   /*开启的*/
    ValveClosed,   /*关闭的*/
    ValveCuted,    /*断线(异常)*/
	ValveStocked,  /*堵转(异常)*/
	ValveMoving,   /*运动的*/
}en_APP_valve_state_t;


/*阀门的到位开关状态*/
#define V_Opened      (0x00)
#define V_Closed      (0x01)
#define V_BothLow     (0x02)
#define V_BothHigh    (0x03)
#define V_NoneInit    (0xff)

void API_Valve_Init(void);

bool API_Valve_Close(void);
bool API_Valve_Open(void);

uint8_t API_Valve_StateRead(void);

#endif

